import os

from openGaussMigrate.common.base import Base


class Macro(Base):
    def __init__(self, arg):
        super(Macro, self).__init__()
        self.arg = arg

    @property
    def info(self):
        macro_f = os.path.join(os.getcwd(), 'conf', 'macro.conf')
        res = self.get_node_yaml(macro_f, self.arg, 'INFO')
        return res


class Node(Base):
    def __init__(self, arg):
        super(Node, self).__init__()
        self.arg = arg

    @property
    def info(self):
        node_f = os.path.join(os.getcwd(), 'conf', 'node.conf')
        res = self.get_node_yaml(node_f, self.arg, 'INFO')
        return res
